package com.chixing.controller;

import com.chixing.pojo.Car;
import com.chixing.service.CarService;
import com.chixing.service.HotCarService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HotCarController {
    @Autowired
    private HotCarService hotCarService;
    @GetMapping("car/hotcar")
    @ResponseBody
    public ServerResponse getHotCarByConditions(){
//        ServerResponse serverResponse = hotCarService.getHotCarByConditions();
//        ModelAndView mav = new ModelAndView();
//        mav.addObject("serverResponse",serverResponse);
//        mav.setViewName("index");
        return hotCarService.getHotCarByConditions();
    }
}
